from django.db import models

# Create your models here.
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import gettext_lazy as _


class CustomUser(AbstractUser):
    """
    自定义用户模型，扩展 Django 默认用户
    """
    bio = models.TextField(_("个人简介"), blank=True)
    avatar = models.ImageField(_("头像"), upload_to='avatars/', blank=True, null=True)
    website = models.URLField(_("个人网站"), blank=True)

    class Meta:
        verbose_name = _("用户")
        verbose_name_plural = _("用户")

    def __str__(self):
        return self.username

